package com.icoolkj.microservices.order.contorller;

import com.icoolkj.microservices.order.dto.OrderRequest;
import com.icoolkj.microservices.order.service.OrderService;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*;

/**
 * @author icoolkj
 * @version 1.0
 * @description
 * @createDate 2024/11/10 21:20
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/order")
public class OrderController {

    private final OrderService orderService;

    @PostMapping
    @ResponseStatus(HttpStatus.CREATED)
    public String placeOrder(@RequestBody OrderRequest orderRequest) {
        orderService.placeOrder(orderRequest);
        return "Order Placed successfully";
    }

}
